import java.util.Date;

public class Triangle extends GeometricObject{

    public double side1 = 1.0;
    public double side2 = 1.0;
    public double side3 = 1.0;

    Triangle(){

    }
    Triangle(double r1,double r2,double r3,String color,boolean filied){
        super(color,filied);
        side1 = r1;
        side2 = r2;
        side3 = r3;
    }
    @Override
    public String getColor() {
        return color;
    }

    @Override
    public boolean isFilied() {
        return filied;
    }

    @Override
    public void setFilied(boolean filied) {
        this.filied = filied;
    }

    @Override
    public Date getDateCreate() {
        return null;
    }

    @Override
    public String toString() {
        return "Triangle: side1 = " + side1 + "side2 = " + side2 + "side3 = " + side3;
    }

    public double getArea(){
        double p = (side1 + side2 + side3) / 2;
        return Math.sqrt(p * (p - side3) * (p - side1) * (p - side2));
    }
    public double getPerimeter(){
        return side1 + side2 + side3;
    }
}
